﻿#ifndef SINGLE_TCPSERVER_H
#define SINGLE_TCPSERVER_H

typedef struct SingleTcpServer SingleTcpServer_T;

SingleTcpServer_T* SingleTcpServer_Create();
void SingleTcpServer_Destroy(SingleTcpServer_T* self);

int SingleTcpServer_Read(SingleTcpServer_T* self, char* buf, int len); /*最多读len个字节的数据。返回值：<0:错误码；[0,len]:正确 */
int SingleTcpServer_Write(SingleTcpServer_T* self, const char* buf, int len); /*最多写len个字节的数据。返回值：<0:错误码；[0,len]:正确*/
int SingleTcpServer_Reset(SingleTcpServer_T* self); /*发生错误后用来重置*/

#endif